public class Solution1252 {
    public int oddCells(int m, int n, int[][] indices) {
        int[][] f=new int[m][n];
        for (int[] index : indices) {
            for (int i=0;i<n;i++){
                f[index[0]][i]++;
            }
            for (int i=0;i<m;i++){
                f[i][index[1]]++;
            }
        }
        int ans=0;
        for (int i=0;i<m;i++){
            for (int j=0;j<n;j++){
                if (f[i][j]%2==1){
                    ans++;
                }
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1252().oddCells(2,3,new int[][]{{0,1},{1,1}}));
    }
}
